#include "los_task.h"
#include "cmsis_os2.h"
#include <stdio.h>

#define WTD_STACK_SIZE 0x1000
#define WTD_TASK_NAME "watchdog_service"
#define WTD_TASK_PRIORITY 5


void* WTDEntry(void* arg)
{
    while (1)
    {
        at32_WTD_Update();
        LOS_TaskDelay(200);
    }
}


void WTD_Service(void)
{
    UINT32 ret;
    UINT32 taskID1;
    TSK_INIT_PARAM_S stTask = {0};

    printf("WTD service start...\n");
    stTask.pfnTaskEntry = (TSK_ENTRY_FUNC)WTDEntry;
    stTask.uwStackSize = WTD_STACK_SIZE;
    stTask.pcName = WTD_TASK_NAME;
    stTask.usTaskPrio = WTD_TASK_PRIORITY;
    ret = LOS_TaskCreate(&taskID1, &stTask);
    if (ret != LOS_OK) {
        printf("usart TestEntry failed\n");
    }
}


SYS_RUN(WTD_Service);

